
const express = require('express')
const router = express.Router()

// 获取仓库库存
router.get('/inventory', (req, res) => {
  const inventory = [
    {
      warehouse: '中央仓',
      location: '北京',
      items: [
        { name: '有机蔬菜', quantity: 5000, unit: 'kg', temperature: '2-4℃' },
        { name: '精品水果', quantity: 2000, unit: 'kg', temperature: '0-2℃' }
      ]
    },
    {
      warehouse: '区域分仓',
      location: '上海',
      items: [
        { name: '新鲜牛奶', quantity: 800, unit: 'L', temperature: '0-4℃' },
        { name: '草鸡蛋', quantity: 1200, unit: '盒', temperature: '常温' }
      ]
    }
  ]
  res.json(inventory)
})

// 获取分拣任务
router.get('/sorting-tasks', (req, res) => {
  const tasks = [
    {
      id: 'ST20241101001',
      warehouse: '中央仓',
      items: [
        { name: '有机蔬菜', quantity: 100, unit: 'kg', target: '门店A' },
        { name: '精品水果', quantity: 50, unit: 'kg', target: '门店B' }
      ],
      status: '进行中',
      progress: 65,
      accuracy: 99.7
    }
  ]
  res.json(tasks)
})

module.exports = router
